﻿<Window x:Class="TfsBuildManager.Views.BuildControllerWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:TfsBuildManager.Controls;assembly=TFSBuildManager.Controls" 
        xmlns:Views="clr-namespace:TfsBuildManager.Views" 
        WindowStartupLocation="CenterScreen"
        Title="Select Build Controller" 
        Height="300" Width="400" ResizeMode="NoResize" Icon="Graphics/AppIcon.ico">
    <Grid Name="Grid1">
        <Grid.Resources>
            <Style TargetType="{x:Type GridViewColumnHeader}">
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="Margin" Value="5,0,0,0"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Controls:SortableListView BorderThickness="0,0,0,0" x:Name="BuildControllerList" ItemsSource="{Binding BuildControllers}" IsManipulationEnabled="False" SelectionMode="Single" Height="Auto">
            <ListView.Resources>
                <DataTemplate x:Key="BuildControllerTemplate">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <TextBlock Text="{Binding Name}" Margin="3,0,0,1" VerticalAlignment="Bottom" ToolTip="{Binding Tags}"/>
                    </StackPanel>
                </DataTemplate>

            </ListView.Resources>
            <ListView.View>
                <GridView>
                    <Controls:SortableGridViewColumn Header="Build Controller" SortPropertyName="BuildController" IsDefaultSortColumn="True" CellTemplate="{StaticResource BuildControllerTemplate}" Width="370"/>
                </GridView>
            </ListView.View>
        </Controls:SortableListView>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,5">
            <Button IsDefault="True" Name="btnOK" Margin="5" Padding="20,3,20,3" Click="OnOK">OK</Button>
            <Button IsDefault="False" IsCancel="True" Name="btnCancel" Margin="5" Padding="15,3,15,3" Click="OnCancel">Cancel</Button>
        </StackPanel>
    </Grid>

</Window>
